package com.mihuo.entity.common;

import com.mihuo.entity.AppUser;
import com.mihuo.entity.constant.Constant;
import lombok.Data;

import java.util.Arrays;
import java.util.List;

@Data
public class AuthUser {
    private Long userId;
    private String nickname;
    private List<String> roles; // 角色信息，例如 "USER,ADMIN"

    public AuthUser(AppUser user){
        this.userId = user.getId();
        this.nickname = user.getNickname();
        this.roles = Arrays.asList(Constant.ROLE_NORMAL);
    }
}